package lianxi3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("创建容器");

        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext("lianxi3");
        System.out.println("创建完毕");

        Person person = context.getBean(Person.class);
        System.out.println("获取对象"+person);
        System.out.println("person对象其他操作");
        System.out.println("关闭容器");
        context.close();
    }
}
